package twilight.companion.init;

import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.MobCategory;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;
import twilight.companion.TwilightCompanion;
import twilight.companion.entity.MiniYetiEntity;
import twilight.companion.entity.SummonSkullEntity;
import twilight.companion.entity.RotatingSnowBlockEntity;

public class ModEntities {
    public static final DeferredRegister<EntityType<?>> ENTITY_TYPES = DeferredRegister
            .create(ForgeRegistries.ENTITY_TYPES, TwilightCompanion.MOD_ID);

    public static final RegistryObject<EntityType<MiniYetiEntity>> MINI_YETI = ENTITY_TYPES.register("mini_yeti",
            () -> EntityType.Builder.of(MiniYetiEntity::new, MobCategory.CREATURE)
                    .sized(1.14F, 1.65F)
                    .build("mini_yeti"));

    public static final RegistryObject<EntityType<SummonSkullEntity>> SUMMON_SKULL = ENTITY_TYPES.register("summon_skull",
            () -> EntityType.Builder.<SummonSkullEntity>of(SummonSkullEntity::new, MobCategory.MISC)
                    .sized(0.5F, 0.5F)
                    .clientTrackingRange(64)
                    .updateInterval(1)
                    .build("summon_skull"));

    public static final RegistryObject<EntityType<RotatingSnowBlockEntity>> ROTATING_SNOW_BLOCK = ENTITY_TYPES.register("rotating_snow_block",
            () -> EntityType.Builder.<RotatingSnowBlockEntity>of(RotatingSnowBlockEntity::new, MobCategory.MISC)
                    .sized(1.0F, 1.0F)
                    .clientTrackingRange(64)
                    .updateInterval(1)
                    .build("rotating_snow_block"));

    public static void register(IEventBus eventBus) {
        ENTITY_TYPES.register(eventBus);
    }
}